
// <copyright file="DefaultBlankStrategy.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   The default blank strategy.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Xml
{
    using System.Xml;

    /// <summary>
    /// The default blank strategy.
    /// </summary>
    public sealed class DefaultBlankStrategy : IBlankStrategy
    {
        #region Static Fields

        /// <summary>
        /// The instance.
        /// </summary>
        private static readonly DefaultBlankStrategy InstanceObject = new DefaultBlankStrategy();

        #endregion Static Fields

        #region Constructors and Finalizers

        /// <summary>
        /// Prevents a default instance of the <see cref="DefaultBlankStrategy"/> class from being created.
        /// </summary>
        private DefaultBlankStrategy()
        {
        }

        #endregion Constructors and Finalizers

        #region Public Properties

        /// <summary>
        /// Gets the instance.
        /// </summary>
        public static DefaultBlankStrategy Instance
        {
            get
            {
                return InstanceObject;
            }
        }

        #endregion Public Properties

        #region Public Methods and Operators

        /// <summary>
        /// The is blank.
        /// </summary>
        /// <param name="attribute">
        /// The attribute.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public bool IsBlank(XmlAttribute attribute)
        {
            return attribute.Value != null && attribute.Value.Length > 1 && attribute.Value[0] == '@' && attribute.Value[attribute.Value.Length - 1] == '@';
        }

        #endregion Public Methods and Operators
    }
}
